//
//  GRLocationManager.h
//  YC_GRice
//
//  Created by LiuFeng on 2018/7/13.
//  Copyright © 2018年 YeCai. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AMapSearchKit/AMapSearchKit.h>
#import <AMapLocationKit/AMapLocationKit.h>

static const NSString *LocationKey  = @"LocationKey";
static const NSString *DragMapKey = @"DragMapKey";
static const NSString *FreshLoc = @"FreshLoc";

typedef void(^PoiCompletionHandler)(NSArray<AMapPOI *> *pois, BOOL aroundRequest);

@interface GRLocationManager : NSObject


/**
 下方两个属性：仅用于记录当前的位置，实现快速归位
 */
@property (nonatomic, assign) CLLocationCoordinate2D currentLocation;
@property (nonatomic, strong) AMapPOI *currentpoi;

/**
 下方两个属性用于请求传参使用
 */
@property (nonatomic, assign) CLLocationCoordinate2D coordinate;
@property (nonatomic, copy) NSString *adcode;
@property (nonatomic, copy) NSString *city;

// plist对应的城市
@property (nonatomic, strong) NSArray *letterKeys;
@property (nonatomic, strong) NSDictionary *cityDictionary;

@property (nonatomic, copy) PoiCompletionHandler completionHandler;  // POI搜索结果回调

/**
 定位单例

 @return <#return value description#>
 */
+ (instancetype)defaultManager;

/**
 开始定位
 */
- (void)startUpdatingLocation;

/**
 周围搜索
 */
-(void)poiAroundSearch:(CLLocationCoordinate2D)coordinate;

/**
 逆地理搜索请求
 
 @param coordinate 搜索中心点
 */
- (void)poiRegeocodeSearch:(CLLocationCoordinate2D )coordinate;

/**
 poi关键字搜索

 @param keyword 关键字
 @param city 城市
 */
- (void)poiKeyWord:(NSString *)keyword city:(NSString *)city;

@end
